﻿using System;

namespace Net.FlowField
{
    // A* Pathfinding Node
    public class AStarNode : IComparable<AStarNode>
    {
        public Vector3 Position;
        public int GCost; // Distance from start
        public int HCost; // Heuristic distance to end
        public int FCost => GCost + HCost;
        public int Token;
        public AStarNode Parent;

        public int CompareTo(AStarNode other)
        {
            int compare = FCost.CompareTo(other.FCost);
            if (compare == 0)
                compare = HCost.CompareTo(other.HCost);
            return compare;
        }
    }
}